//
//  KDEditeCell.m
//  PublicSentimentMonitorSystem
//
//  Created by 魏强 on 15/11/4.
//  Copyright © 2015年 魏强. All rights reserved.
//

#import "KDEditeCell.h"
#import "KDEditeCellModel.h"
@interface KDEditeCell ()
@property (weak, nonatomic) IBOutlet UILabel *nameLb;

@end

@implementation KDEditeCell

- (void)awakeFromNib {
    // Initialization code
}
+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellId =@"KDEditeCell";
    
    UINib *xib = [UINib nibWithNibName:@"KDEditeCell" bundle:nil];
    [tableView registerNib:xib forCellReuseIdentifier:cellId];
    KDEditeCell *cell =[tableView dequeueReusableCellWithIdentifier:cellId];
    cell.selectionStyle = UITableViewCellSelectionStyleNone; 
    return cell;

}
- (void)setModel:(KDEditeCellModel *)model{
    _model = model;
    self.nameLb.text = model.name;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)deleteBtnClick:(UIButton *)sender {
    if (_delegate && [_delegate respondsToSelector:@selector(KDEditeCell:deleteBtnClickWithModel:)]) {
        [_delegate KDEditeCell:self deleteBtnClickWithModel:self.model];
    }
}

@end
